package com.ss.android.newmedia.feedback;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

public final class g {
    public long a;
    public long b;
    public String c;
    public String d;
    public String e;
    public int f;
    public int g;
    public int h;
    public String i;
    public List j;
    public g(long arg2) {
        this(arg2, (byte) 0);
    }

    private g(long arg2, byte arg4) {

        this.a = arg2;
    }

    public final void a() {
        int v0_2;
        a v5;
        int v2;
        if (!android.support.design.a.isTextEmpty(this.i)) {
            try {
                JSONArray v3 = new JSONArray(this.i);
                int v4 = v3.length();
                if (v4 == 0) {
                    return;
                }

                this.j = new ArrayList();
                v2 = 0;
                while (true) {
                    label_14:
                    if (v2 >= v4) {
                        return;
                    }

                    JSONObject v0_1 = v3.getJSONObject(v2);
                    v5 = new a(this);
                    v5.a = v0_1.optInt("start", -1);
                    v5.b = v0_1.optInt("length", -1);
                    v5.c = v0_1.optString("url");
                    if (v5.a < 0) {
                        break;
                    } else if (v5.b < 0) {
                        break;
                    } else if (android.support.design.a.isTextEmpty(v5.d.c)) {
                        break;
                    } else if (v5.a + v5.b <= v5.d.c.length()) {
                        v0_2 = 1;
                    } else {
                        v0_2 = 0;
                    }
                    try {
                        if (v0_2 != 0) {
                            this.j.add(v5);
                        }
                    } catch (Exception v0) {
                        return;
                    }

                    ++v2;
                    continue;
                }
            } catch (Exception v0) {
                return;
            }


        }
    }

    public final void a(JSONObject arg4) {
        this.b = arg4.optLong("pub_date");
        this.c = arg4.optString("content");
        this.d = arg4.optString("image_url");
        this.e = arg4.optString("avatar_url");
        this.f = arg4.optInt("image_width", 0);
        this.g = arg4.optInt("image_height", 0);
        this.h = arg4.optInt("type", 0);
        this.i = arg4.optString("links");
    }

    public final class a {
        private final g d;
        public int a;
        public int b;
        public String c;

        public a(g arg1) {
            this.d = arg1;

        }
    }
}

